Skip to content

Conversation

dkropachev
Copy link
Collaborator

  1. Switch to CPack
  2. Add workflows to build packages and populate existing release with them

Pre-review checklist

  • I have split my patch into logically separate commits.
  • All commit messages clearly explain what they change and why.
  • PR description sums up the changes and reasons why they should be introduced.
  • I have implemented Rust unit tests for the features/changes introduced.
  • I have enabled appropriate tests in Makefile in {SCYLLA,CASSANDRA}_(NO_VALGRIND_)TEST_FILTER.
  • I added appropriate Fixes: annotations to PR description.

@dkropachev dkropachev force-pushed the dk/switch-to-cpack-for-packaging branch 6 times, most recently from d1d9612 to 552f8f1 Compare October 1, 2025 15:13
Windows building fails with:
```
error[E0308]: mismatched types
     --> src\cass_error.rs:137:81
      |
  137 |                 CassError((CassErrorSource::CASS_ERROR_SOURCE_SERVER.0 << 24) | (*num as u32))
      |                                                                                 ^^^^^^^^^^^^^ expected `i32`, found `u32`

  error[E0277]: no implementation for `i32 | u32`
     --> src\cass_error.rs:137:79
      |
  137 |                 CassError((CassErrorSource::CASS_ERROR_SOURCE_SERVER.0 << 24) | (*num as u32))
      |                                                                               ^ no implementation for `i32 | u32`
```
@dkropachev dkropachev force-pushed the dk/switch-to-cpack-for-packaging branch 8 times, most recently from 2802f9a to 81c2641 Compare October 6, 2025 19:04
@dkropachev dkropachev force-pushed the dk/switch-to-cpack-for-packaging branch from 81c2641 to 4c2a4dd Compare October 6, 2025 19:42
Copy link
Collaborator

@wprzytula wprzytula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, the approach looks correct. Not knowing CPack, I'm not sure though.

set(CPACK_PACKAGE_CONTACT "ScyllaDB <info@scylladb.com>")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY
"ScyllaDB C++ driver backed by the Rust core driver")
set(CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/scylladb/cpp-rust-driver")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔧

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
set(CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/scylladb/cpp-rust-driver")
set(CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/scylladb/cpp-rs-driver")

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

set(CPACK_GENERATOR "productbuild;DragNDrop")
set(CPACK_PACKAGE_FILE_NAME
"${_CPACK_PACKAGE_NAME}-${PROJECT_VERSION_STRING}-macos")
set(CPACK_PRODUCTBUILD_IDENTIFIER "com.scylladb.cpp-rust-driver")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ Sometimes you write cpp-driver and sometimes cpp-rust-driver. Is the discrepancy intended?

🔧 cpp-rust-driver -> cpp-rs-driver

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines +38 to +40
11. Build binary packages with CPack on each target platform (Linux, macOS, Windows). The README provides the exact command sequence (`cmake -S`, `cmake --build`, `cpack -G <generator>`). If you do not have access to the platforms locally, trigger a run of the reusable workflow `.github/workflows/build-cpack-packages.yml` from another workflow and download the resulting artifacts.
12. Go to https://github.com/scylladb/cpp-rust-driver/releases , click the `Draft new release` button and follow the procedure to create a new release on GitHub. Use the release notes as its description.
13. After the release is published, the `Attach Packages to Release` workflow (`.github/workflows/release-upload-packages.yml`) automatically builds fresh packages using CPack and uploads every artifact to the release. Verify that the workflow finished successfully and that RPM/DEB/MSI/PKG/DMG files are attached.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ What is the intended difference between building packages in point 11 and 13?

Comment on lines +446 to +447
Debian packages set shlibdeps automatically; RPM packages target the
`Applications/Databases` group and use release number `1` by default.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ What does it mean? It's all Greek to me.

Comment on lines +454 to +455
Both outputs bundle the compiled libraries alongside headers and pkg-config
manifests.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ This also uses naming that is unknown to me.

Comment on lines +137 to +141
// On windows enums are i32, so we need to cast it
#[allow(clippy::unnecessary_cast)]
let source = CassErrorSource::CASS_ERROR_SOURCE_SERVER.0 as u32;
let code = (source << 24) | (*num as u32);
CassError(code as _)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quite an unexpected catch.

Comment on lines +4 to +33
workflow_call:
inputs:
build-type:
description: CMake build type used for packaging
type: string
default: Release
extra-cmake-flags:
description: Additional flags passed to CMake configure step
type: string
default: ""
save-artifacts:
description: Save built packages as artifacts
type: boolean
default: false
secrets: {}
workflow_dispatch:
inputs:
build-type:
description: CMake build type used for packaging
type: string
default: Release
extra-cmake-flags:
description: Additional flags passed to CMake configure step
type: string
default: ""
save-artifacts:
description: Save built packages as artifacts
type: boolean
default: false
secrets: {}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 It's a pity we need to be that WET instead of DRY. Chat GPT, however, hasn't come up with a better solution for enabling both manual dispatch and being called from another workflow, both with the same parameters and configuration.

Comment on lines +3 to +5
SHELL = bash

SHELL = bash
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ Why the duplication?

Comment on lines +5 to +7
SHELL = bash
ifeq ($(OS),Windows_NT)
SHELL := pwsh.exe
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔧 I believe it's an error to mix eager binding := operator with late binding operator = for the same variable. Do you agree?

sudo dpkg -i "${DRIVER_PACKAGES[@]}"
sudo apt-get install -f -y
- name: Build smoke-test application package
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⛏️ Let's add a missing (DEB and RPM) suffix, so this step's name isconsistency with other steps ((DEB) only) is explicit.

@wprzytula wprzytula added this to the 1.0.0 milestone Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants